<script>
    $(function () {
        //款项类型
        $("#form_fksh_tx").find("[idVal='fksh_kxyt_id']").sjzdcombobox("kxyt");

        //票据类型
        $("#form_fksh_tx").find("[idVal='fksh_pjlx_id']").sjzdcombobox("pjlx");

        //回款类型
        $("#form_fksh_tx").find("[idVal='sksh_hklx_id']").sjzdcombobox("hklx");
        //选择客户和二级账户
        $("#fksh_gldw_id").zcombobox({
            url: $.webPath() + '/organ/gsjg/gsjgandqyjg_qclist',
            param: "qc",
            valueField: "id",
            textField: "qc",
            keylength: 2,
            readonly:false,
            onSelect: function (data) {
                var url = $.webPath() + "/organ/ejzh/findEjzhByKhId?nbgsId="+$("#fksh_sbgs_id").val()+"&&khId="+  data.id;
                $.post(url,function(data){
                    $("#fksh_dfejzh_id").val(data[0]["id"]);
                    $("#fksh_dfejzh_jc").val(data[0]["jc"]);
                    $("#form_fksh_tx [name='ejzhye']").val(data[0]["ye"]);
                    $.messager.alert("提示","当前账户余额:"+formatJe(data[0]["ye"],",",".","￥"),"info");
                    $('#fksh_sfje').parent().tooltip({
                        position:'top',
                        content:'<span style="color:#ff0000">当前账户余额:'+formatJe(data[0]["ye"],",",".","￥")+'</span>'
                    });
                },"json");
            },
            onClear:function(target){
                $("#fksh_dfejzh_id").val("");
                $("#fksh_dfejzh_jc").val("");
                $("#form_fksh_tx [name='ejzhye']").val(0);
                $('#fksh_sfje').parent().tooltip("destroy");
            }
        });
    });
</script>
<form id="form_fksh_tx" method="post">
    <#--<input name="fksh.id" type="hidden" value="${(sksh.id)!''}"/>-->
    <#--<input name="fksh.zt" type="hidden" value="${(sksh.zt)!''}"/>-->
    <input name="ejzhye" type="hidden"/>
    <table style="width:100%" class="tb tab-t">
        <col width="90px;"/>
        <col width=""/>
        <col width="90px;"/>
        <col width=""/>
        <#--<tr>-->
            <#--<th>单&nbsp;据&nbsp;&nbsp;号：</th>-->
            <#--<td>-->
                <#--<input id="sksh_bm" name="sksh.bm" type="hidden" class="input-text readonly"-->
                       <#--readonly="readonly" value="${(sksh.bm)!}"/>-->
                <#--<span>${(sksh.bm)!}</span>-->
            <#--</td>-->
        <#--</tr>-->
        <tr>
            <th style="color:#f45212;">
                客户名称：
            </th>
            <td>
                <input id="fksh_gldw_id" name="fksh.gldw.id" type="text" value="${(fksh.gldw.id)!''}"
                       class="input-text"/>
            </td>
            <th style="color:#f45212;"> 二级账户：</th>
            <td>
                <input id="fksh_dfejzh_id" name="fksh.dfejzh.id"  type="hidden"/>
                <input id="fksh_dfejzh_jc" name="fksh.dfejzh.jc"  type="text" class="input-text" required="true" readonly="readonly"/>
            </td>
        </tr>
        <tr>
            <th style="color:#f45212;"> 款项用途：</th>
            <td>
                <input idVal="fksh_kxyt_id" name="fksh.kxyt.id" class="input-text" type="text"
                       required="true" value="${(fksh.kxyt.id)!'90591'}"/>
            </td>
            <th style="color:#f45212;">提现金额：</th>
            <td>
                <input id="fksh_sfje" name="fksh.sfje" type="text" style="width:128px;"
                       class="easyui-numberbox input-text"
                       data-options="precision:4,min:0"
                       required="true"
                       value="${(fksh.sfje?string("0.00"))!''}"/>（元）
            </td>
        </tr>
        <tr>
            <th style="color:#f45212;"> 票据类型：</th>
            <td>
                <input idVal="fksh_pjlx_id" name="fksh.pjlx.id" class="input-text" type="text"
                       required="true" value="${(fksh.pjlx.id)!''}"/>
            </td>
            <th style="color:#f45212;">提现日期：</th>
            <td>
                <input name="fksh.sfkrq" type="text" class="easyui-datebox input-text"
                       required="true" value="${(fksh.sfkrq?date)!''}"/>
            </td>
        </tr>

        <tr>
            <th>申报公司：</th>
            <td>
            <#--<input id="sksh_sbgs_id" name="sksh.sbgs.id" type="text" class="input-text"-->
            <#--value="<#if sksh??>${(sksh.sbgs.id)!}<#else>${(skzggsId)!}</#if>"/>-->
                <input id="fksh_sbgs_id" type="hidden" name="fksh.sbgs.id" class=" input-text"
                       value="${(fksh.sbgs.id)!}"
                        >
                <input type="text" class=" input-text" value="${(fksh.sbgs.jc)!} " readonly="readonly"
                        >
            </td>
            <th>申&nbsp;报&nbsp;&nbsp;人：</th>
            <td>
                <input type="hidden" name="fksh.sbr.id" class=" input-text" value="${(fksh.sbr.id)!}"
                        >
                <input type="text" class=" input-text" value="${(fksh.sbr.xm)!}"
                       readonly="readonly">
            </td>
        </tr>
        <tr>
            <th>备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</th>
            <td>
                <textarea style="width:468px;" rows="3" class="textarea" name="fksh.bz">${(fksh.bz)!}</textarea>
            </td>
        </tr>
    </table>
</form>
